import request from '../../utils/request'

/**
 * 保存海运费
 * 
 */
export async function addFreightFee( data ) {
	return request(apiPath.mc + "/api/freight", {
		method: 'post',
		data
	});
}


 /**
  * 修改海运费
  *
  */
export async function updateFreightFee( data ) {
    return request(apiPath.mc + "/api/freight", {
        method: 'put',
        data
    });
}


  /**
   * 删除海运费
   * 
   */
export async function deleteById({ id }){
    return request(apiPath.mc + "/api/freight/" + id,{
        method: 'delete'
    });
}
   
   /**
    *根据id获取海运费
    *
    */
export async function getFreightFeeById({ id }){
    return request(apiPath.mc +  "/api/freight/" + id,{
        method: 'get'
    });
}


    /**
     * 分页获取海运费列表
     * 
     */
export async function getListForPage({ supplier, airline, berthing, beginTime, endTime, loadingPort, destinationPort, page}){
    return request(apiPath.mc + "/api/freight",{
        method: 'get',
        data: { supplier, airline, berthing, beginTime, endTime, loadingPort, destinationPort, page: page.page, size: page.size }
    });
}
